package com.fzdy.product.service.impl;

import com.fzdy.product.dao.ProductTypeDao;
import com.fzdy.product.entity.ProductType;
import com.fzdy.product.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductTypeServiceImpl implements ProductTypeService {
    @Autowired
    private ProductTypeDao productTypeDao;

    @Override
    public List<ProductType> getAll() {
        return productTypeDao.findAll();
    }

    @Override
    public boolean save(ProductType type) {
        try {
            productTypeDao.save(type);
            return true;
        }catch (Exception ex){
            return false;
        }
    }
}
